package model;

public class Food extends Product {
    private String expireDate; // 保质期

    public Food(String pid, String name, double price, String expireDate) {
        super(pid, name, price);
        this.expireDate = expireDate;
    }

    public String getExpireDate() { return expireDate; }

    @Override
    public String getDescription() {
        return getBasicInfo() + ", 类别:食品, 保质期:" + expireDate;
    }

    public void eat() {
        System.out.println("【" + getName() + "】食用前请确认保质期：" + expireDate);
    }
}